<?php
session_start();

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");

require("dbconn.php");

$helenaam = "Meneer Beheer";
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>iCUP - Beheer</title>
<!--<meta http-equiv="X-UA-Compatible" content="IE=8" />-->
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="hourtable.css" />
<link rel="stylesheet" type="text/css" href="teachertable.css" />
<link rel="stylesheet" type="text/css" href="Buttons.css" />
<script type="text/javascript" src="funcs.js"></script>
<script type="text/javascript" src="selectivizr.js"></script>
</head>
<?php


	$QUERY = "
		SELECT DISTINCT week 
		FROM studieuur
		ORDER BY week ASC";
	$resultweeknr = mysql_query($QUERY);

	$QUERY = "
		SELECT dag, uur, id 
		FROM studieuur
		WHERE week = '" . mysql_result($resultweeknr, 0, "week") . "'";
	$resultuurnr = mysql_query($QUERY);
	
	$QUERY = "";
	

?><body>
	<table border="none" width="100%" height="96%" rules="none" frame="void" cellspacing="0" style="color: white; font-size: 17px; text-align: center; position: fixed;">
		<tr>
			<td width="256" height="157" bgcolor="#303030" style="padding: 5px 5px 5px 5px;">
				<img width="256" height="157" style="display: block;" src="pics/logo.png" />
			</td>
			<td rowspan="6" height="100%" style="vertical-align: top;">
				<div id="scrollcontainer">
					<div id="content">
					</div>
				</div>
			</td>
		</tr>
		<tr>
			<td bgcolor="#303030" style="padding: 5px 5px 5px 5px;">Welkom <?php print($helenaam); ?><div>&nbsp;</div></td>
		</tr>
		<tr>
			<td bgcolor="#303030" style="padding: 5px 5px 5px 5px;">
				<div>De volgende weken zijn beschikbaar: </div>
				<table align="center">
					<tr>
<?php for($i = 0; $i < mysql_num_rows($resultweeknr); $i++) {
?>						<td><a id="wk_<?php print(mysql_result($resultweeknr, $i, "week"));?>" onclick="selectweek('<?php print(mysql_result($resultweeknr, $i, "week"));?>')" href="#" class="wk_button"><?php print(mysql_result($resultweeknr, $i, "week"));?></a></td>
<?php if ($i%4 == 0 && $i > 0) {
?>					</tr>
					<tr>
<?php } } 
?>					</tr>
				</table>
				<table align="right">
					<tr>
						<td><a onclick="addentireweek();" class="actionbutton"><img src="pics/addweek.png" /></a></td>
						<td><a onclick="delentireweek();" class="actionbutton"><img src="pics/delweek.png" /></a></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td bgcolor="#303030" style="padding: 5px 5px 5px 5px;">
				<div>De volgende uren zijn beschikbaar: </div>
				<div id="hours">
					<table align="center">
						<tr>
<?php for($i = 0; $i < mysql_num_rows($resultuurnr); $i++) { 
?>								<td><a id="su_<?php print(mysql_result($resultuurnr, $i, "id"));?>" onclick="gethours('<?php print(mysql_result($resultuurnr, $i, "id")); ?>')" href="#" class="wk_button"><?php print(mysql_result($resultuurnr, $i, "dag") . mysql_result($resultuurnr, $i, "uur"));?></a></td>
<?php if ($i%4 == 0 && $i > 0) {
?>						</tr>
						<tr>
<?php } } 
?>						</tr>
					</table>
					<table align="right">
						<tr>
							<td><a onclick="addentirehour();" class="actionbutton"><img src="pics/addweek.png" /></a></td>
							<td><a onclick="delentirehour();" class="actionbutton"><img src="pics/delweek.png" /></a></td>
						</tr>
					</table>
				</div>
			</td>
		</tr>
		<tr>
			<td bgcolor="#303030" style="padding: 5px 5px 5px 5px;">
				<table width="100%">
					<tr><td align="center"><a onclick="editteachers();" class="menubutton">Beheer leraren</a></td></tr>
					<tr><td align="center"><a onclick="editpupils();" class="menubutton">Beheer leerlingen</a></td></tr>
					<tr><td align="center"><a onclick="editclasses();" class="menubutton">Beheer klassen</a></td></tr>
					<tr><td align="center"><a onclick="editplaces();" class="menubutton">Beheer plaatsen</a></td></tr>
					<tr><td align="center"><a href="beheerfuncs.php?logout" class="menubutton">Uitloggen</a></td></tr>
					<tr><td align="center"><a href="http://snakespear.co.de/iCUP/" class="menubutton">Reclame!!!</a></td></tr>
				</table>
			</td>
		</tr>
		<tr style="height:100%;"><td bgcolor="#303030" style="padding: 5px 5px 5px 5px;">&nbsp;</td></tr>
	</table>
</body>
</html>